/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SISAC.DACEA.DA;

import SISAC.DACEA.DS.Conexion;
import SISAC.DACEA.ENTITY.Matricula;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Types;

/**
 *
 * @author Abel
 */
public class MatriculaDA {
    
    public synchronized void Matricular(Matricula oMatricula){
                
        Connection cn=null;
        CallableStatement call=null;
        
        try {
            String sql= "{CALL Matricular(?,?,?,?,?)}";
           
            cn=new Conexion().getConnection();
            call=cn.prepareCall(sql);
            
            call.setInt(1,oMatricula.getCodigoAlumno());
            call.setInt(2, oMatricula.getCodigoSalon());
            call.setInt(3, oMatricula.getCodigoCiclo());
            call.setDate(4, oMatricula.getFechaMaticula());
            call.registerOutParameter(5, Types.INTEGER);
            
            
            call.executeUpdate();
            
        } catch (Exception e) {
            System.out.println("Error al matricular alumno"+e);
        }
    }
}
